// jquery.throbber.js
(function ($) {
    function Throbber () {
    }
    
    Throbber.prototype.load = function () {
        this.modal({
            template: Application.Contenido.find('#jquery-throbber').html()
        });

        this.find('#modal-container').addClass('throbber');
        
        this.find('#close-button, #modal-shadow').off('click');
    };

    Throbber.prototype.remove = function () {
        this.find('#modal-shadow').remove();
        this.find('#modal-container').remove();
    };

	$.throbber = function (method) {
        var el = $('body');
        method = method || 'load';

        Throbber.prototype[method].apply(el, arguments);
    };
}(jQuery));
